package src.week05transaction;
//代
public class PersonServiceProxy implements PersonService{
    private PersonService personService;
    public PersonServiceProxy(PersonService personService){
    this.personService=personService;
    }

    public void save() {
        TransactionManager.begain();
        personService.save();
        TransactionManager.commit();
    }

    public void update() {
        TransactionManager.begain();
        personService.update();
        TransactionManager.commit();
    }

    public void delete() {
        TransactionManager.begain();
        personService.delete();
        TransactionManager.commit();
    }

    public void list() {
        personService.list();

    }
}
